#define  _CRT_SECURE_NO_WARNINGS


struct TreeNode {
    int val;
    struct TreeNode* left;
    struct TreeNode* right;
    TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
};

class Solution {
public:
    TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) {
        TreeNode* cur1 = t1, * cur2 = t2;
        inorder(t1, t2);
    }

    void inorder(TreeNode* t1, TreeNode* t2)
    {
        if (t1 && t2) t1->val += t2->val;
        else if(!t1 && t2) {}
    }
};

class Solution {
public:
    TreeNode* mergeTrees(TreeNode* t1, TreeNode* t2) {
        if (!t1 && !t2) return nullptr;

        if (!t1) return t2;
        if (!t2) return t1;

        TreeNode* merge = new TreeNode(t1->val + t2->val);
        merge->left = mergeTrees(t1->left, t2->left);
        merge->right = mergeTrees(t1->right, t2->right);

        return merge;
    }
};